<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
// while循环
   var i = 1;
   while (i <= 5){
       document.write(i + " ");
       i++;
   }
   document.write("<hr>")

   //do while循环
   var j = 1;
   do{
       document.write(j + " ");
       j++
   }while (j <= 5);

</script>

</body>
</html>